package com.zenq.ssm.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zenq.ssm.entity.Admin;
import com.zenq.ssm.mapper.AdminMapper;

@Service
public class AdminService {

	@Autowired
	private AdminMapper adminMapper;
	/**
	 * 管理员登录
	 * @param loginAdmin
	 * @return
	 */
	public Admin login(Admin loginAdmin) {
		Admin admin = adminMapper.selectByUsername(loginAdmin.getUsername());
		if (admin != null) {
			if (admin.getPassword().equals(loginAdmin.getPassword())) {
				return admin;
			}
		}
		return null;
	}
}
